/**
 * 
 */
package com.et114.modules.products.netbook.dao;

import java.util.List;

import com.et114.components.simpletable.DataList;
import com.et114.components.simpletable.dao.SimpleTableDAOImpl;
import com.et114.modules.products.netbook.vo.NetBook;
import com.et114.modules.products.search.SearchVo;

/*
 * @author guanhw
 */
public class NetBookDao extends SimpleTableDAOImpl {
	public DataList getNetBooks( NetBook vo ) throws Exception { 
		return queryListDataList ( vo , "getNetBooks" ) ; 
	}
	
	@ SuppressWarnings ( "unchecked" )
	public List< NetBook > getNetBookList( NetBook vo ) throws Exception {
		return queryList( vo , "getNetBooksNpage" ) ; 
	}
	
	
	@ SuppressWarnings ( "unchecked" )
	public List< NetBook > getNetBooks4( NetBook vo ) throws Exception {
		return queryList( vo , "getNetBooks4" ) ;
	}
	
	public Long countgetNetBooks4View( NetBook vo ) throws Exception { 
		return getCount( vo , "countgetNetBooks4View" ) ;
	}
	
	public Long countgetNetBooks( NetBook vo ) throws Exception { 
		return getCount( vo , "countgetNetBooks" ) ;
	}
	
	@ SuppressWarnings ( "unchecked" )
	public List< NetBook > getNetBooks4Manager( NetBook vo ) throws Exception {
		return queryList( vo , "getNetBooks4Manager" ) ;
	}		
	
	@ SuppressWarnings ( "unchecked" )
	public List< NetBook  > getNetBooksHasOffTime( NetBook vo ) throws Exception {
		return queryList( vo , "getNetBooksHasOffTime" ) ; 
	}
	
	public NetBook getNetBookById( Long id ) throws Exception {
		return ( NetBook ) load( id , "getNetBookById" ) ; 
	}
	
	public Long saveNetBook( NetBook vo ) throws Exception {
		return ( Long ) insert( vo , "insertNetBook" ) ; 
	} 
	
	public void updateNetBook( NetBook vo ) throws Exception {
		update( vo , "updateNetBook" ) ; 
	}
	
	public void updateNetBookProOnOffStatus( NetBook vo ) throws Exception {
		update( vo , "updateNetBookProOnOffStatus" ) ;
	}
	
	public void removeNetBook( Long id ) throws Exception{ 
		delete( id , "removeNetBook" ) ;
	}
	
	//4 1
	public DataList getNetBooks4View( NetBook vo ) throws Exception {  
		return queryListDataList ( vo , "getNetBooks4View" ) ; 
	}
	
	
	public NetBook getBaseNetBookInfoById4View( NetBook vo ) throws Exception {
		return ( NetBook ) load( vo , "getBaseNetBookInfoById4View" ) ; 
	}
	
	public SearchVo getNetBook4Compass( Long proId ) {
		return ( SearchVo )load(  new SearchVo( proId ) , "getNetBook4Compass" ) ;
	}
}
